package ar.com.sectorwine.repository;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import ar.com.sectorwine.entities.Stock;

public interface StockRepository  extends JpaRepository<Stock, Long> {
	
	List<Stock> findAllByAlcohol(String alcohol);
	
	
		@Query("SELECT DISTINCT e.productos FROM Empresa e INNER JOIN e.productos s WHERE e.id = :idEmpresa AND s.baja = FALSE")
		List<Stock> listarStockDeAlta(@Param("idEmpresa") Long idEmpresa);

}
